/**
 * Copyright (C), 2021, 因特驰
 * FileName: FuwubaozhangController
 * Author:   李晋武
 * Date:     2021/7/13 14:48
 * Description:
 * History:
 * 李晋武          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.esc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 〈服务保障〉<br>
 * 〈〉
 *
 * @author Yun
 * @create 2021/7/13
 * @since 1.0.0
 */
@Controller
@RequestMapping("fuwubaozhang")
public class FuwubaozhangController {

    @RequestMapping("index")
    public String index(Model model, HttpServletRequest request){

        //买家登录
        String buyerName = (String) request.getSession().getAttribute("buyerName");
        if (buyerName!=null){
            model.addAttribute("buyerName",buyerName);
            //request.getSession().setAttribute("sellerName","");
        }else {
            model.addAttribute("buyerName","");
        }
        //卖家登录
        String sellerName = (String) request.getSession().getAttribute("sellerName");
        if (sellerName!=null){
            model.addAttribute("sellerName",sellerName);
            //request.getSession().setAttribute("buyerName","");
        }else {
            model.addAttribute("sellerName","");
        }

        return "fuwubaozhang/index";
    }
}